<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <style>
        div{
            width: 500px;
            height:500px;
            border:1px pink solid;
        }
    </style>
</head>
<body>
鼠标位置：<span id="mouseLocation"></span>
<div>
    鼠标移入进来试试
</div>
</body>
<script>
    //当网页加载完成后触发事件
    $(function (){
        $("div").mousemove(function (location) {
            $("#mouseLocation").text('x坐标 :' + location.pageX + ', y坐标 :' + location.pageY);
        })
    })
</script>
</html>